Skip to content

fix: close_task handler no longer overwrites the task creation comment#87

Closed
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1775191182-fix-close-task-clobbers-create-comment
Closed

fix: close_task handler no longer overwrites the task creation comment#87
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1775191182-fix-close-task-clobbers-create-comment

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot commented Apr 3, 2026

Summary

The CloseTaskHandler used "Task created:" as the matchPrefix when posting the "Task completed." comment via commentOnIssue. Because commentOnIssue finds and overwrites an existing comment matching that prefix, this caused the original "Task created: {taskUrl}" comment to be replaced with "Task completed." — permanently destroying the task URL link on the issue.

The fix changes the matchPrefix to "Task completed" so the close comment is written independently, preserving both comments on the issue.

Review & Testing Checklist for Human

  • Confirm the original behavior was unintentional. It's possible the team wanted to replace the "Task created" comment on close. If so, this PR changes that behavior — issues will now retain both the "Task created: {url}" and "Task completed." comments. Verify this is the desired UX.
  • Test end-to-end: Assign an issue to trigger task creation (confirm "Task created: {url}" comment appears), then close the issue (confirm "Task completed." appears as a separate comment and the original "Task created" comment is preserved with the task URL intact).

Notes

  • The commentOnIssue API uses the matchPrefix parameter to find an existing comment to update (upsert behavior). The bug was that both create and close handlers shared the same prefix, causing close to clobber create.
  • After this fix, repeated issue closes will still be idempotent — the "Task completed" prefix ensures the close comment updates itself in place.

Link to Devin session: https://app.devin.ai/sessions/6eff2b924cfe4705863335acd5b82463
Requested by: @neekolas

Note

Fix CloseTaskHandler to pass "Task completed" instead of "Task created:" when commenting on issue close

The fifth argument to github.commentOnIssue in close-task.ts was incorrectly set to "Task created:", causing the task creation comment to be overwritten on close. It now correctly passes "Task completed".

Macroscope summarized a76f92b.

The close_task handler used matchPrefix "Task created:" when posting
"Task completed.", which caused commentOnIssue to find and overwrite
the original "Task created: {taskUrl}" comment. This destroyed the
task URL link permanently once the issue was closed.

Fix: use matchPrefix "Task completed" so the close comment is
independent from the create comment. Both comments are now preserved
on the issue.

Co-Authored-By: Nick Molnar <iam+git@nicholasmolnar.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@macroscopeapp
Copy link
Copy Markdown

macroscopeapp bot commented Apr 3, 2026

Approvability

Verdict: Approved

Simple bug fix that changes a string constant used as a comment marker from 'Task created:' to 'Task completed', preventing the close_task handler from overwriting the wrong comment. The change is minimal, test-covered, and the intent is clear.

You can customize Macroscope's approvability policy. Learn more.

@devin-ai-integration
Copy link
Copy Markdown
Author

Closing — the overwrite behavior is intentional (task URL stops working after completion).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant